﻿Public Class DisplayStyles
    Inherits System.Collections.CollectionBase

    Public Sub Add(ByVal DisplayStyleToAdd As DisplayStyle)
        Try
            List.Add(DisplayStyleToAdd)
        Catch ex As Exception
            '
            'TODO: Error Handling
            '
        End Try
    End Sub

    Public Sub Remove(ByVal IndexOfDisplayStyleToRemove As Integer)
        Try
            If IndexOfDisplayStyleToRemove > Count - 1 Or IndexOfDisplayStyleToRemove < 0 Then
                Throw New Exception("An invalid index was given for the Display Style to remove.")
            Else
                List.RemoveAt(IndexOfDisplayStyleToRemove)
            End If
        Catch ex As Exception
            '
            'TODO: Error Handling
            '
        End Try
    End Sub

    Default Public ReadOnly Property Item(ByVal IndexOfDisplayStyleToRetrieve As Integer) As DisplayStyle
        Get
            Try
                If IndexOfDisplayStyleToRetrieve > Count - 1 Or IndexOfDisplayStyleToRetrieve < 0 Then
                    Throw New Exception("An invalid index was given for the Display Style to retrieve.")
                Else
                    Return CType(List.Item(IndexOfDisplayStyleToRetrieve), DisplayStyle)
                End If
            Catch ex As Exception
                '
                'TODO: Error Handling
                '
                Return Nothing
            End Try
        End Get
    End Property
End Class
